package com.yq.cp.controller.data;

import com.alibaba.fastjson.JSONObject;
import com.yq.cp.entity.common.ApiResult;
import com.yq.cp.entity.data.vo.NkDataVo;
import com.yq.cp.service.data.NkDataService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据推送接口
 * </p>
 *
 * @author zh
 * @since 2023-03-17
 */
@RestController
@RequestMapping("/kl")
public class KlController {

    @Resource
    NkDataService nkDataService;
    @RequestMapping("/redirect_url")
    public ApiResult redirect(HttpServletRequest request){
        Map<String, String[]> params = new HashMap<>();
        Enumeration<String> paramNames = request.getParameterNames();

        while (paramNames.hasMoreElements()) {
            String paramName = paramNames.nextElement();
            String[] paramValues = request.getParameterValues(paramName);
            params.put(paramName, paramValues);
        }
        System.out.println(JSONObject.toJSONString(params));
        return ApiResult.ok();
    }
}
